﻿@model RestApp.UI.Models.JobFact

@{
    ViewBag.Title = "FillTime";
}

<link href="~/Content/Clockpicker/clockpicker.css" rel="stylesheet" />

<h2>@ViewData["userName"]</h2>

@using (Html.BeginForm()) 
{
    @Html.AntiForgeryToken()
    
	@Html.Hidden("IdWorkGraphic", (int)ViewData["idGraphic"])
    @Html.Hidden("idUser", (int)ViewData["idUser"])
	
    <div class="form-horizontal">
        <h4>Заполнение фактов отработанного времени на @ViewData["graphicDate"]</h4>
        <hr />
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        <div class="form-group">
            @Html.LabelFor(model => model.TimeStart, htmlAttributes: new { @class = "control-label col-md-3" })
            <div class="col-md-9">
                @Html.EditorFor(model => model.TimeStart, new { htmlAttributes = new { @class = "form-control", @readonly = "true" } })
                @Html.ValidationMessageFor(model => model.TimeStart, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.TimeEnd, htmlAttributes: new { @class = "control-label col-md-3" })
            <div class="col-md-9">
                @Html.EditorFor(model => model.TimeEnd, new { htmlAttributes = new { @class = "form-control", @readonly = "true" } })
                @Html.ValidationMessageFor(model => model.TimeEnd, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.NormWork, htmlAttributes: new { @class = "control-label col-md-3" })
            <div class="col-md-9">
                <div class="checkbox">
                    @Html.EditorFor(model => model.NormWork)
                    @Html.ValidationMessageFor(model => model.NormWork, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.IsReasondForWorkCancelation, htmlAttributes: new { @class = "control-label col-md-3" })
            <div class="col-md-9">
                <div class="checkbox">
                    @Html.EditorFor(model => model.IsReasondForWorkCancelation)
                    @Html.ValidationMessageFor(model => model.IsReasondForWorkCancelation, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.NoWork, htmlAttributes: new { @class = "control-label col-md-3" })
            <div class="col-md-9">
                <div class="checkbox">
                    @Html.EditorFor(model => model.NoWork)
                    @Html.ValidationMessageFor(model => model.NoWork, "", new { @class = "text-danger" })
                </div>
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Comment, htmlAttributes: new { @class = "control-label col-md-3" })
            <div class="col-md-9">
                @Html.EditorFor(model => model.Comment, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Comment, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Добавить" class="btn btn-default" />
                <input type="button" value="Очистить форму" class="btn btn-default" id="clearForm" />
            </div>
        </div>
    </div>
}

<div>
    @Html.ActionLink("Назад", "FillFacts", new { id = ViewData["idUser"] })
</div>

@section scripts{
	@Scripts.Render("~/bundles/fillJobTime")
}